#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

#include <sys/shm.h>

#include <stdio.h>
#include <fcntl.h>

int main()
{
	key_t key_sem_common  = ftok( ".for_keys", 10);
	key_t key_shm_common 		= ftok( ".for_keys", 20);
	
	
	int sem_id_common  = semget( key_sem_common,4, NULL);
	

	
	int val;
	val = semctl( sem_id_common , 0,GETVAL);
	printf("IN = %d\t",val);
	val = semctl( sem_id_common, 1,GETVAL);
	printf("OUT = %d\t",val);

	
	val = semctl( sem_id_common , 2,GETVAL);
	printf("Empty = %d\t",val);
	val = semctl( sem_id_common, 3,GETVAL);
	printf("Full = %d\n",val);
	
	
	
	
	semctl( sem_id_common, 0, IPC_RMID, 0);
	
	
	return 0;
}